package com.lhkj.ct.wechat.base.model.vo;

import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.io.Serializable;

public class JsapiResult implements Serializable {
    private static final long serialVersionUID = 4465376277943307271L;

    @JsonProperty(index = 1)
    private String appId;

    @JsonProperty(index = 2)
    private String timeStamp;

    @JsonProperty(index = 3)
    private String nonceStr;

    @JsonProperty(index = 4)

    private String packageValue;

    @JsonProperty(index = 5)
    private String signType;

    @JsonProperty(index = 6)
    private String paySign;

    @JsonProperty(index = 7)
    private boolean free;

    private String getPrepayId() {
        return getPackageValue().split("=")[1];
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    @JsonGetter(value = "package")
    public String getPackageValue() {
        return packageValue;
    }

    public void setPackageValue(String packageValue) {
        this.packageValue = packageValue;
    }

    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    public String getPaySign() {
        return paySign;
    }

    public void setPaySign(String paySign) {
        this.paySign = paySign;
    }

    @JsonGetter(value = "free")
    public boolean isFree() {
        return free;
    }

    public void setFree(boolean free) {
        this.free = free;
    }
}
